package com.aloha.boot03.controller;

import com.aloha.boot03.domain.User;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * @author DaiZhiHeng
 * @date 2023/10/9 16:18
 */
@RestController
@RequestMapping("/cs/target")
public class TargetController {

    @GetMapping("/test/get")
    public Object testGet(@RequestParam("id") Integer id) {
        Map<String, Object> ans = new HashMap<>();
        ans.put("id", id);
        return ans;
    }

    @PostMapping("/test/post")
    public Object testPost(@RequestBody User user) {
        Map<String, Object> ans = new HashMap<>();
        ans.put("user", user);
        return ans;
    }
}
